import java.awt.Point;


public class ObjectLoad {
public int id;
public int type;
public int x;
public int y;
public int w;
public int h;
public double alpha;
public int r;
ObjectLoad(int x,int y,int w,int h,double alpha,int type){
this.x=x;
this.y=y;
this.w=w;
this.h=h;
this.alpha=alpha;
this.type=type;
}
ObjectLoad(int x, int y,int r,int type){
this.x=x;
this.y=y;
this.r=r;
this.type=type;
}
public Point ReturnPoint(int index){
Point temp=new Point();
Point top=new Point();
Point bot=new Point();
bot.x=this.x-(int)(h/2*Math.cos(this.alpha*Math.PI/180.0));
bot.y=this.y-(int)(h/2*Math.sin(this.alpha*Math.PI/180.0));
top.x=this.x+(int)(h/2*Math.cos(this.alpha*Math.PI/180.0));
top.y=this.y+(int)(h/2*Math.sin(this.alpha*Math.PI/180.0));
			if(index==1) {
				temp.x=bot.x-(int)(w/2*Math.cos((90.0+this.alpha)*Math.PI/180.0));
				temp.y=bot.y-(int)(w/2*Math.sin((90.0+this.alpha)*Math.PI/180.0));
			}
			if(index==2){
				temp.x=bot.x+(int)(w/2*Math.cos((90.0+this.alpha)*Math.PI/180.0));
				temp.y=bot.y+(int)(w/2*Math.sin((90.0+this.alpha)*Math.PI/180.0));
			}
			if(index==4){
				//temp.x=top.x+(int)(w/2*Math.cos(90.0-this.alpha));
				//temp.y=top.y+(int)(w/2*Math.sin(90.0-this.alpha));
				//System.out.println("this is temp x in rec:"+String.valueOf(temp.x));
				temp.x=(int)(2*this.x-(bot.x+(w/2*Math.cos((90.0+this.alpha)*Math.PI/180.0))));
				temp.y=(int)(2*this.y-(bot.y+(w/2*Math.sin((90.0+this.alpha)*Math.PI/180.0))));
			}
			if(index==3){
				//temp.x=top.x-(int)(w/2*Math.cos(90.0-this.alpha));
				//temp.y=top.y-(int)(w/2*Math.sin(90.0-this.alpha));
				temp.x=2*this.x-(bot.x-(int)(w/2*Math.cos((90.0+this.alpha)*Math.PI/180.0)));
				temp.y=2*this.y-(bot.y-(int)(w/2*Math.sin((90.0+this.alpha)*Math.PI/180.0)));
			}
		//	System.out.println(temp.x);
		//	System.out.println(temp.y);
return temp;
}
public int getType() {
	return type;
}
public void setType(int type) {
	this.type = type;
}
public int getX() {
	return x;
}
public void setX(int x) {
	this.x = x;
}
public int getY() {
	return y;
}
public void setY(int y) {
	this.y = y;
}
public int getW() {
	return w;
}
public void setW(int w) {
	this.w = w;
}
public int getH() {
	return h;
}
public void setH(int h) {
	this.h = h;
}
public Double getAlpha() {
	return alpha;
}
public void setAlpha(Double alpha) {
	this.alpha = alpha;
}
public int getR() {
	return r;
}
public void setR(int r) {
	this.r = r;
}

}
